package org.huangrui.spark.java.bean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

import java.io.Serializable;

/**
 * @Author hr
 * @Create 2024-10-21 7:56
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CityCount implements Serializable, Comparable<CityCount> {
    private String cityName;
    private Long count;

    @Override
    public int compareTo(@NotNull CityCount o) {
        /*if ( this.count < o.count ) {
            return 1;
        } else if ( this.count > o.count ) {
            return -1;
        } else {
            return 0;
        }*/
        return o.count.compareTo(this.count);
    }
}
